package com.ld.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.ld.pojo.Dept;
import com.ld.service.DeptService;
import com.ld.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: Liudao
 * @Date: 2022-08-10-22:00
 * @Description:
 */
@RestController
@RequestMapping("/dept")
public class DeptController {
    @Reference
    private DeptService deptService;

    @RequestMapping("/list")
    public R list(){
        List<Dept> depts =  deptService.list();
        return R.ok().data("data",depts);
    }
}
